import axios from "@/axios";

// 获取个性化推荐
export function getPersonalizedRecommendations(limit = 10) {
    return axios.get("/recommendation/personalized", {
        params: { limit }
    })
}

// 获取热门推荐
export function getPopularRecommendations(limit = 10) {
    return axios.get("/recommendation/popular", {
        params: { limit }
    })
}

// 获取相似文章推荐
export function getSimilarArticleRecommendations(articleId, limit = 5) {
    return axios.get(`/recommendation/similar/${articleId}`, {
        params: { limit }
    })
}

// 记录用户行为
export function recordUserBehavior(articleId, behaviorType) {
    return axios.post("/recommendation/behavior", null, {
        params: { articleId, behaviorType }
    })
}

// 行为类型常量
export const BEHAVIOR_TYPES = {
    VIEW: 1,      // 浏览
    LIKE: 2,      // 点赞
    FAVORITE: 3,  // 收藏
    SHARE: 4      // 分享
}
